import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-07-21
 * Time: 10:15
 */
public class NorUser extends User{
    public NorUser(String name){
        super(name);
        array=new Port[]{
                new ExitBooks(),
                new FindBooks(),
                new ShowBooks(),
                new BorrowBooks(),
                new ReturnBooks(),
        };
    }

    public void menu(){
        System.out.println("       NorUser::menu");
        System.out.println("  欢迎"+this.name+"使用图书馆系统");
        System.out.println("       1:查找书籍");
        System.out.println("       2:展示书籍");
        System.out.println("       3:借阅书籍");
        System.out.println("       4:归还书籍");
        System.out.println("       0:退出系统");
        System.out.println("////////////////////////////");
    }

    @Override
    public void doWork(BookList bookList) {
        int choice;
        Scanner scanner=new Scanner(System.in);
        while(true){
            menu();
            choice=scanner.nextInt();
            array[choice].work(bookList);
        }
    }
}
